import request from '@/utils/request'

/**
 * 根据分组名称获取数据字典下拉
 *
 * @export
 * @param {*} data { groupName }
 * @returns dictList
 */
export function fetchDropDictionaryList(data) {
  return request({
    url: '/common/dropdown/getDictionaryList',
    method: 'post',
    data
  })
}

/**
 * 根据级别和kpi获取指标下级部门
 *
 * @export
 * @param {*} data { businessLevel: 0, kpiNameList: ['string'] }
 * @returns deptList
 */
export function fetchDropLowerLevelDept(data) {
  return request({
    url: '/common/dropdown/selectLowerLevelDept',
    method: 'post',
    data
  })
}

/**
 * 获取总部指标数据
 *
 * @export
 * @param {*} data { businessLevel: 0, kpiNameList: ['string'] }
 * @returns deptList
 */
export function getDeptKpiTree(data) {
  return request({
    url: '/common/dropdown/getDeptKpiTree',
    method: 'post',
    data
  })
}
export function fetchDropSmsTemplate(data) {
  return request({
    url: '/common/dropdown/selectSmsTemplateList',
    method: 'post',
    data
  })
}

/**
 * 获取项目区域指标数据
 *
 * @export
 * @param {*} data { businessLevel: 0, kpiNameList: ['string'] }
 * @returns deptList
 */
export function getProAreaKpiTree(data) {
  return request({
    url: '/common/dropdown/getProAreaKpiTree',
    method: 'post',
    data
  })
}

export function fetchDropTaskTemplate(data) {
  return request({
    url: '/common/dropdown/selectTaskTemplateList',
    method: 'post',
    data
  })
}

/**
 * 整改建议模板下拉
 *
 * @export
 * @param {*} data { 无 }
 * @returns smsTemplateList
 */
export function fetchDropReformTemplate(data) {
  return request({
    url: '/common/dropdown/selectImproveRecommendTemplateList',
    method: 'post',
    data
  })
}

/**
 * 群组下拉
 *
 * @export
 * @param {*} data { 无 }
 * @returns groupTemplateList
 */
export function fetchDropGroupList(data) {
  return request({
    url: '/common/dropdown/getGroupList',
    method: 'post',
    data
  })
}

/**
 * 获取数据报告模板下拉
 *
 * @export
 * @param {*} data { 无 }
 * @returns groupTemplateList
 */
export function fetchDropReportList(data) {
  return request({
    url: '/common/dropdown/getDataReportTemplateList',
    method: 'post',
    data
  })
}

/**
 * 获取已创业务下拉
 *
 * @export
 * @param {*} data { 无 }
 * @returns groupTemplateList
 */
export function fetchDropBustList(data = {}) {
  return request({
    url: '/common/dropdown/getHomeBusinessList',
    method: 'post',
    data
  })
}
